<<<<<<< HEAD
Page({
  data: {
    list: [
      {
      name: '所有服务',
      id: 0
    },
    {
      name: '在提供',
      id: 1
    },
    {
      name: '正在找',
      id: 2
    }
  ],
  hint:0, //下滑线
  swiperList:[
        {
            "id": 1,
            "name": "保洁"
        },
        {
            "id": 2,
            "name": "汽修"
        },
        {
            "id": 3,
            "name": "疏通"
        },
    ],
    slideid:0,
    beginclientX:0,
    bindend:0
  },
  onLoad(options) {

  },
  bindchange(e) {
   let {id} = e.detail
   this.setData({
    hint:id
  })
  console.log(this.data.hint)
  },
  // 滑块
  bindslide(e) {
    let {id} = e.currentTarget.dataset
=======
import Service from "../../model/service";
const service = new Service()
import Category from '../../model/category'
Page({
  /**
   * 页面的初始数据
   */
  data: {
    tabs: ['全部服务','在提供','正在找'],
    currentTabIndex: 0,
    categoryList:[],
    // 列表
    serviceList:[]
  },
  
  onLoad: function (options) {
    this._getServiceList()
    this._getCategoryList()
    },
   async _getServiceList() {
      // 发起网络请求，获取服务列表的数据
    const res= await service.getServiceList()
     this.setData({
      serviceList:res
     })
    console.log(res)
    },

  handlswitchover (e) {
    const {index} = e.currentTarget.dataset
    console.log(index)
>>>>>>> 6043a317c93d6fdc10271baf5995ab1c1feddbc3
    this.setData({
      slideid:id
    })
    console.log(this.data.slideid)
  },
<<<<<<< HEAD
  bindmove(e) {
    console.log(e)
  },
  onReady() {

  },
  onShow() {

  },
  onHide() {

  },
  onUnload() {

  },
  onShareAppMessage() {
    return {
      title: '',
    };
  },
});
=======
  handlviewswiper (e) {
     console.log(e)
     const {id} = e.currentTarget.dataset
     console.log(id)
   },
  //  滑动切换 
  handleslidebegin(e) {
    console.log(e)
  },
  handleslidefinish (e) {
    console.log(e)
  },
  // 调用模型调用数据  
  async _getCategoryList() {
    const categoryList = await Category.getCategoryListWithAll()
    console.log(categoryList)
    this.setData({
      categoryList
    })
  },
  // 下拉刷新
  onPullDownRefresh() {
    console.log(222)
  },
  // 上拉触底 刷新
  onReachBottom() {
    console.log(111)
  }
})
>>>>>>> 6043a317c93d6fdc10271baf5995ab1c1feddbc3
